{extend name="template/base" /}
{block name="style"}
{php}use think\Db;{/php}
<!--select2样式 start -->
<link href="__LIB__/select2-4.0.3/dist/css/select2.min.css" rel="stylesheet" />
<!--select2样式 end -->
<link rel="stylesheet" href="__LIB__/webuploader/0.1.5/webuploader.css" />
<link rel="stylesheet" href="__LIB__/fontawesome-4.2.0_ie7/4.2.0/css/font-awesome.min.css" />
<link rel="stylesheet" type="text/css" href="__LIB__/tags-input/dist/jquery.tagsinput.min.css" />
<style>
    select[multiple]+.layui-form-select>.layui-select-title>input.layui-input{ border-bottom: 0}
    select[multiple]+.layui-form-select dd{ padding:0;}
    select[multiple]+.layui-form-select .layui-form-checkbox[lay-skin=primary]{ margin:0 !important; display:block; line-height:36px !important; position:relative; padding-left:26px;}
    select[multiple]+.layui-form-select .layui-form-checkbox[lay-skin=primary] span{line-height:36px !important; float:none;}
    select[multiple]+.layui-form-select .layui-form-checkbox[lay-skin=primary] i{ position:absolute; left:10px; top:0; margin-top:9px;}
    .multiSelect{ line-height:normal; height:auto; padding:4px 10px; overflow:hidden;min-height:38px; margin-top:-38px; left:0; z-index:99;position:relative;background:none;}
    .multiSelect a{ padding:2px 5px; background:#908e8e; border-radius:2px; color:#fff; display:block; line-height:20px; height:20px; margin:2px 5px 2px 0; float:left;}
    .multiSelect a span{ float:left;}
    .multiSelect a i {float:left;display:block;margin:2px 0 0 2px;border-radius:2px;width:8px;height:8px;padding:4px;position:relative;-webkit-transition:all .3s;transition:all .3s}
    .multiSelect a i:before, .multiSelect a i:after {position:absolute;left:8px;top:2px;content:'';height:12px;width:1px;background-color:#fff}
    .multiSelect a i:before {-webkit-transform:rotate(45deg);transform:rotate(45deg)}
    .multiSelect a i:after {-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}
    .multiSelect a i:hover{ background-color:#545556;}
    .multiOption{display: inline-block; padding: 0 5px;cursor: pointer; color: #999;}
    .multiOption:hover{color: #5FB878}

    @font-face {font-family: "iconfont"; src: url('data:application/x-font-woff;charset=utf-8;base64,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elzRiT8oZ0j/AAlabsgAAAB4nGNgYoAALgbsgJWRiZGZkYWRlZGNgbGCuzw1MykzMb8kU1eXs7A0Ma8CiA05CjPz0rPz89IZGADc3QvXAAAA') format('woff')}
    .iconfont {font-family:"iconfont" !important;font-size:16px;font-style:normal;-webkit-font-smoothing: antialiased;-moz-osx-font-smoothing: grayscale;}
    .icon-fanxuan:before { content: "\e837"; }
    .icon-quanxuan:before { content: "\e623"; }
    .icon-qingkong:before { content: "\e63e"; }
</style>
<link rel="stylesheet" href="/static/admin/layui-xia/css/layui.css" media="all"/>
<link rel="stylesheet" href="/static/admin/formSelects/dist/formSelects-v4.css">
<style>
    .ui-menu-item{
        background:#cde69c;
        border-bottom: 1px solid #a5d24a;
        display:block;
        text-align:center;
        width:125px;
    }
    .ui-menu-item div{
        color:#638421;
        font-size:13px;
        display:inline-block;
        cursor:pointer;
        text-align:center;
        padding:10px;
    }
    .ui-menu-item:hover{
        background:#b8d483;
    }
</style>
{/block}
{block name="content"}
<div class="page-container">
    <form class="form form-horizontal" id="form" method="post" action="{:\\think\\Request::instance()->baseUrl()}">
        <input type="hidden" name="id" value="{$vo.id ?? ''}">
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">用户：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <select name="user_id" class="select2"  id="user_id">
                    {empty name = "$vo['user_id']"}
                    <option value="">选择用户</option>
                    {/empty}
                    {volist name="users" id="user"}
                    <option value="{$user['id']}"  >{$user['id']}：{$user['realname']}：{$user['mobile']}</option>
                    {/volist}
                </select>
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">标签：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <?php
                    $tags = [];
                    if($vo['tag']){
                        $tags = explode(',',$vo['tag']);
                    }
                ?>
                <select name="tag[]" id="" xm-select="select1">
                    <option value="0" disabled="disabled">请选择标签</option>
                    {foreach $tag as $tv}
                        <option {if in_array($tv['id'],$tags)} selected {/if} value="{$tv.id}">{$tv.chinese}</option>
                    {/foreach}
                </select>
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">司机类型：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <div style="width:250px;display: inline-block" class="input-text">
                    {php}$driver_type = Db::name('driver_type')->select();{/php}
                    <select name="driver_type" class="select" id="driver_type" style="border: solid 1px #ffffff">
                        <option value="">选择司机类型</option>
                        {volist name="driver_type" id="driver_type"}
                        <option value="{$driver_type.id}" selected>{$driver_type.name}</option>
                        {/volist}
                    </select>
                </div>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">车牌号：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" placeholder="车牌号" name="plate_number" value="{$vo.plate_number ?? ''}" >
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">行驶证有效期：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" autocomplete="off" class="input-text Wdate  " style="width:250px" placeholder="行驶证有效期" name="driving_permit_date" value="{$vo.driving_permit_date ?? ''}" {literal} onfocus="WdatePicker({dateFmt: 'yyyy-MM-dd'})" {/literal} >
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">司机等级：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <div style="width:250px;display: inline-block" class="input-text">
                    <select name="driver_rank_id" class="select" id="driver_rank_id" style="border: solid 1px #ffffff">
                        <option value="">选择司机等级</option>
                        <option value="0">新手</option>
                        {volist name="driverRank" id="driverRanks"}
                            <option value="{$driverRanks.id}">{$driverRanks.name}</option>
                        {/volist}
                    </select>
                </div>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">车辆等级：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" autocomplete="off" class="input-text" style="width:250px" placeholder="请输入车辆等级" name="vehicle_level" value="{$vo.vehicle_level ?? ''}"/>
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">民族：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <!--<input type="text" class="input-text" placeholder="民族" name="nationality" value="{$vo.nationality ?? ''}" >-->
                <div class="select-box">
                    <select name="nationality" class="select" id="nations">
                        <option value="">请选择民族</option>
                        {volist name="nation" id="nations"}
                        <option {if ($vo['nationality'] == $nations['nationality'])} selected {/if} value="{$nations['nationality']}"  >{$nations['nationality']}</option>
                        {/volist}
                    </select>
                </div>
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">家乡：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" placeholder="家乡" name="hometown" value="{$vo.hometown ?? ''}" >
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">驾照号码：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" placeholder="驾照号码" name="driver_license_number" value="{$vo.driver_license_number ?? ''}" >
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">驾照有效期：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" autocomplete="off" class="input-text Wdate  " style="width:250px" placeholder="驾照有效期" name="driver_license_date" value="{$vo.driver_license_date ?? ''}" {literal} onfocus="WdatePicker({dateFmt: 'yyyy-MM-dd'})" {/literal} >
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">汽车出厂日期：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" autocomplete="off" class="input-text Wdate  " style="width:250px" placeholder="汽车出厂日期" name="car_product_date" value="{$vo.car_product_date ?? ''}" {literal} onfocus="WdatePicker({dateFmt: 'yyyy-MM-dd'})" {/literal} >
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">身份证：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" placeholder="身份证" name="id_card" value="{$vo.id_card ?? ''}" >
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">生日：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" autocomplete="off" class="input-text Wdate  " style="width:250px" placeholder="生日" name="birthday" value="{$vo.birthday ?? ''}" {literal} onfocus="WdatePicker({dateFmt: 'yyyy-MM-dd'})" {/literal} >
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">车类型：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <select name="car_type_id" class="select2"  id="car_type_id" onchange="getCarBrand()">
                    {empty name = "$vo['arctic_id']"}
                    <option value="">请选择车辆类型</option>
                    {/empty}
                    {volist name="arctic" id="arctics"}
                    <option value="{$arctics['id']}"  >{$arctics['name']}</option>
                    {/volist}
                </select>
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">车辆品牌：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <select name="car_brand_id" class="select2"  id="car_brand_id" onchange="getCarModel()">
                    {empty name = "$vo['car_brand_id']"}
                    <option value="">请先选择车辆品牌</option>
                    {/empty}
                </select>
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">汽车型号：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <select name="car_model_id" class="select2"  id="car_model_id">
                    {empty name = "$vo['car_model_id']"}
                    <option value="">请先选择汽车型号</option>
                    {/empty}
                </select>
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">微信号：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" placeholder="微信号" name="weixin_no" value="{$vo.weixin_no ?? ''}" >
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">车座位：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <!--<input type="text" class="input-text" placeholder="车座位" name="seats" value="{$vo.seats ?? ''}" >-->
                <select name="seats" class="select2"  id="seats">
                    {empty name = "$vo['seats']"}
                    <option value="">请选择座位数</option>
                    {/empty}
                    {volist name="seat" id="seats"}
                    <option value="{$seats['value']}"  >{$seats['name']}</option>
                    {/volist}
                </select>
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">居住：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" placeholder="居住" name="domicile" value="{$vo.domicile ?? ''}" >
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">头像：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <!--dom结构部分-->
                <div id="head_img" class="uploader">

                    <!--用来存放item-->
                    <div  class="uploader-list fileList">
                        {notempty name="vo.head_img"}
                        <div id="head_img_1" class="file-item thumbnail upload-state-done">

                            <img width="100" height="100" src="{$vo['head_img']}">
                            <div class="info">{$vo['head_img']}</div>
                            <div class="del fa fa-trash-o"> 删除 </div>
                        </div>
                        <script>
                            $(function(){
                                $('#head_img_1').on("click", " .del", function(){

                                    var $li = $('#head_img_1');
                                    $li.remove();
                                })
                            })
                        </script>
                        {/notempty}
                    </div>
                    <div class="filePicker">选择图片</div>
                </div>

            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">车前照：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <!--dom结构部分-->
                <div id="car_front" class="uploader">

                    <!--用来存放item-->
                    <div  class="uploader-list fileList">
                        {notempty name="vo.car_front"}
                        <div id="car_front_1" class="file-item thumbnail upload-state-done">

                            <img width="100" height="100" src="{$vo['car_front']}">
                            <div class="info">{$vo['car_front']}</div>
                            <div class="del fa fa-trash-o"> 删除 </div>
                        </div>
                        <script>
                            $(function(){
                                $('#car_front_1').on("click", " .del", function(){

                                    var $li = $('#car_front_1');
                                    $li.remove();
                                })
                            })
                        </script>
                        {/notempty}
                    </div>
                    <div class="filePicker">选择图片</div>
                </div>

            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>


        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">车后照：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <!--dom结构部分-->
                <div id="car_back" class="uploader">

                    <!--用来存放item-->
                    <div  class="uploader-list fileList">
                        {notempty name="vo.car_back"}
                        <div id="car_back_1" class="file-item thumbnail upload-state-done">

                            <img width="100" height="100" src="{$vo['car_back']}">
                            <div class="info">{$vo['car_back']}</div>
                            <div class="del fa fa-trash-o"> 删除 </div>
                        </div>
                        <script>
                            $(function(){
                                $('#car_back_1').on("click", " .del", function(){

                                    var $li = $('#car_back_1');
                                    $li.remove();
                                })
                            })
                        </script>
                        {/notempty}
                    </div>
                    <div class="filePicker">选择图片</div>
                </div>

            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>


        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">内乘坐区：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <!--dom结构部分-->
                <div id="in_car" class="uploader">

                    <!--用来存放item-->
                    <div  class="uploader-list fileList">
                        {notempty name="vo.in_car"}
                        <div id="in_car_1" class="file-item thumbnail upload-state-done">

                            <img width="100" height="100" src="{$vo['in_car']}">
                            <div class="info">{$vo['in_car']}</div>
                            <div class="del fa fa-trash-o"> 删除 </div>
                        </div>
                        <script>
                            $(function(){
                                $('#in_car_1').on("click", " .del", function(){

                                    var $li = $('#in_car_1');
                                    $li.remove();
                                })
                            })
                        </script>
                        {/notempty}
                    </div>
                    <div class="filePicker">选择图片</div>
                </div>

            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>



        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">后备箱照片：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <!--dom结构部分-->
                <div id="trunk_photo" class="uploader">

                    <!--用来存放item-->
                    <div  class="uploader-list fileList">
                        {notempty name="vo.trunk_photo"}
                        <div id="trunk_photo_1" class="file-item thumbnail upload-state-done">

                            <img width="100" height="100" src="{$vo['trunk_photo']}">
                            <div class="info">{$vo['trunk_photo']}</div>
                            <div class="del fa fa-trash-o"> 删除 </div>
                        </div>
                        <script>
                            $(function(){
                                $('#trunk_photo_1').on("click", " .del", function(){

                                    var $li = $('#trunk_photo_1');
                                    $li.remove();
                                })
                            })
                        </script>
                        {/notempty}
                    </div>
                    <div class="filePicker">选择图片</div>
                </div>

            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>


        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">行驶证照片：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <!--dom结构部分-->
                <div id="driving_permit_img" class="uploader">

                    <!--用来存放item-->
                    <div  class="uploader-list fileList">
                        {notempty name="vo.driving_permit_img"}
                        <div id="driving_permit_img_1" class="file-item thumbnail upload-state-done">

                            <img width="100" height="100" src="{$vo['driving_permit_img']}">
                            <div class="info">{$vo['driving_permit_img']}</div>
                            <div class="del fa fa-trash-o"> 删除 </div>
                        </div>
                        <script>
                            $(function(){
                                $('#driving_permit_img_1').on("click", " .del", function(){

                                    var $li = $('#driving_permit_img_1');
                                    $li.remove();
                                })
                            })
                        </script>
                        {/notempty}
                    </div>
                    <div class="filePicker">选择图片</div>
                </div>

            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">商业险照片：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <!--dom结构部分-->
                <div id="insurance" class="uploader">

                    <!--用来存放item-->
                    <div  class="uploader-list fileList">
                        {notempty name="vo.insurance"}
                        <div id="insurance_1" class="file-item thumbnail upload-state-done">

                            <img width="100" height="100" src="{$vo['insurance']}">
                            <div class="info">{$vo['insurance']}</div>
                            <div class="del fa fa-trash-o"> 删除 </div>
                        </div>
                        <script>
                            $(function(){
                                $('#insurance_1').on("click", " .del", function(){

                                    var $li = $('#insurance_1');
                                    $li.remove();
                                })
                            })
                        </script>
                        {/notempty}
                    </div>
                    <div class="filePicker">选择图片</div>
                </div>

            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>


        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">身份证正面：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <!--dom结构部分-->
                <div id="id_card_front_img" class="uploader">

                    <!--用来存放item-->
                    <div  class="uploader-list fileList">
                        {notempty name="vo.id_card_front_img"}
                        <div id="id_card_front_img_1" class="file-item thumbnail upload-state-done">

                            <img width="100" height="100" src="{$vo['id_card_front_img']}">
                            <div class="info">{$vo['id_card_front_img']}</div>
                            <div class="del fa fa-trash-o"> 删除 </div>
                        </div>
                        <script>
                            $(function(){
                                $('#id_card_front_img_1').on("click", " .del", function(){

                                    var $li = $('#id_card_front_img_1');
                                    $li.remove();
                                })
                            })
                        </script>
                        {/notempty}
                    </div>
                    <div class="filePicker">选择图片</div>
                </div>

            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">身份证反面：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <!--dom结构部分-->
                <div id="id_card_back_img" class="uploader">

                    <!--用来存放item-->
                    <div  class="uploader-list fileList">
                        {notempty name="vo.id_card_back_img"}
                        <div id="id_card_back_img_1" class="file-item thumbnail upload-state-done">

                            <img width="100" height="100" src="{$vo['id_card_back_img']}">
                            <div class="info">{$vo['id_card_back_img']}</div>
                            <div class="del fa fa-trash-o"> 删除 </div>
                        </div>
                        <script>
                            $(function(){
                                $('#id_card_back_img_1').on("click", " .del", function(){

                                    var $li = $('#id_card_back_img_1');
                                    $li.remove();
                                })
                            })
                        </script>
                        {/notempty}
                    </div>
                    <div class="filePicker">选择图片</div>
                </div>

            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">手持身份证照片：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <!--dom结构部分-->
                <div id="take_id_card_img" class="uploader">

                    <!--用来存放item-->
                    <div  class="uploader-list fileList">
                        {notempty name="vo.take_id_card_img"}
                        <div id="take_id_card_img_1" class="file-item thumbnail upload-state-done">

                            <img width="100" height="100" src="{$vo['take_id_card_img']}">
                            <div class="info">{$vo['take_id_card_img']}</div>
                            <div class="del fa fa-trash-o"> 删除 </div>
                        </div>
                        <script>
                            $(function(){
                                $('#take_id_card_img_1').on("click", " .del", function(){

                                    var $li = $('#take_id_card_img_1');
                                    $li.remove();
                                })
                            })
                        </script>
                        {/notempty}
                    </div>
                    <div class="filePicker">选择图片</div>
                </div>

            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">驾照照片：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <!--dom结构部分-->
                <div id="driver_license_img" class="uploader">

                    <!--用来存放item-->
                    <div  class="uploader-list fileList">
                        {notempty name="vo.driver_license_img"}
                        <div id="driver_license_img_1" class="file-item thumbnail upload-state-done">

                            <img width="100" height="100" src="{$vo['driver_license_img']}">
                            <div class="info">{$vo['driver_license_img']}</div>
                            <div class="del fa fa-trash-o"> 删除 </div>
                        </div>
                        <script>
                            $(function(){
                                $('#driver_license_img_1').on("click", " .del", function(){

                                    var $li = $('#driver_license_img_1');
                                    $li.remove();
                                })
                            })
                        </script>
                        {/notempty}
                    </div>
                    <div class="filePicker">选择图片</div>
                </div>

            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>


        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">其它证件：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <!--dom结构部分-->
                <div id="other_certificate" class="uploader">

                    <!--用来存放item-->
                    <div  class="uploader-list fileList">
                        {notempty name="vo.other_certificate"}
                        <div id="other_certificate_1" class="file-item thumbnail upload-state-done">

                            <img width="100" height="100" src="{$vo['other_certificate']}">
                            <div class="info">{$vo['other_certificate']}</div>
                            <div class="del fa fa-trash-o"> 删除 </div>
                        </div>
                        <script>
                            $(function(){
                                $('#other_certificate_1').on("click", " .del", function(){

                                    var $li = $('#other_certificate_1');
                                    $li.remove();
                                })
                            })
                        </script>
                        {/notempty}
                    </div>
                    <div class="filePicker">选择图片</div>
                </div>

            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">其它证件1：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <!--dom结构部分-->
                <div id="other_certificate1" class="uploader">

                    <!--用来存放item-->
                    <div  class="uploader-list fileList">
                        {notempty name="vo.other_certificate1"}
                        <div id="other_certificate1_1" class="file-item thumbnail upload-state-done">

                            <img width="100" height="100" src="{$vo['other_certificate1']}">
                            <div class="info">{$vo['other_certificate1']}</div>
                            <div class="del fa fa-trash-o"> 删除 </div>
                        </div>
                        <script>
                            $(function(){
                                $('#other_certificate1_1').on("click", " .del", function(){

                                    var $li = $('#other_certificate1_1');
                                    $li.remove();
                                })
                            })
                        </script>
                        {/notempty}
                    </div>
                    <div class="filePicker">选择图片</div>
                </div>

            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">其它证件2：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <!--dom结构部分-->
                <div id="other_certificate2" class="uploader">

                    <!--用来存放item-->
                    <div  class="uploader-list fileList">
                        {notempty name="vo.other_certificate2"}
                        <div id="other_certificate2_1" class="file-item thumbnail upload-state-done">

                            <img width="100" height="100" src="{$vo['other_certificate2']}">
                            <div class="info">{$vo['other_certificate2']}</div>
                            <div class="del fa fa-trash-o"> 删除 </div>
                        </div>
                        <script>
                            $(function(){
                                $('#other_certificate2_1').on("click", " .del", function(){

                                    var $li = $('#other_certificate2_1');
                                    $li.remove();
                                })
                            })
                        </script>
                        {/notempty}
                    </div>
                    <div class="filePicker">选择图片</div>
                </div>

            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                <button type="submit" class="btn btn-primary radius">&nbsp;&nbsp;提交&nbsp;&nbsp;</button>
                <button type="button" class="btn btn-default radius ml-20" onClick="layer_close();">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
            </div>
        </div>
    </form>
</div>
{/block}
{block name="script"}
<script type="text/javascript" src="__LIB__/Validform/5.3.2/Validform.min.js"></script>
<script type="text/javascript" src="__LIB__/webuploader/0.1.5/webuploader.js"></script>
<script type="text/javascript" src="__LIB__/webuploader/0.1.5/image-upload/uploadimg.js"></script>

<!--select2 js 插件-->
<script type="text/javascript" src="__LIB__/select2-4.0.3/dist/js/select2.min.js"></script>

<!--时间插件-->
<script type="text/javascript" src="__LIB__/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" charset="utf-8" src="__LIB__/tags-input/dist/jquery.tagsinput.js"></script>
<script type="text/javascript" charset="utf-8" src="__LIB__/tags-input/dist/jquery-ui.js"></script>
<link rel="stylesheet" type="text/css" href="__LIB__/tags-input/dist/jquery-ui.css" />

<script type="text/javascript" src="/static/admin/layui-xia/layui.js"></script>
<script type="text/javascript" src="/static/admin/formSelects/src/formSelects-v4.js"></script>
<script>
    $(function () {

        upload_imgs("head_img");
        upload_imgs("car_front");
        upload_imgs("car_back");
        upload_imgs("in_car");
        upload_imgs("trunk_photo");
        upload_imgs("driving_permit_img");
        upload_imgs("insurance");
        upload_imgs("id_card_front_img");
        upload_imgs("id_card_back_img");
        upload_imgs("take_id_card_img");
        upload_imgs("driver_license_img");
        upload_imgs("other_certificate");
        upload_imgs("other_certificate1");
        upload_imgs("other_certificate2");


        $('#tag').tagsInput({width: 'auto', defaultText: "标签",autocomplete_url: "/admin/driver/tag"});
        $("#form").Validform({
            tiptype: 2,
            ajaxPost: true,
            showAllError: true,
            callback: function (ret){
                ajax_progress(ret);
            }
        });
        //用户select2 js部分 start
        var car_type_id = $("#car_type_id").select2({
            language: "zh-CN", //设置 提示语言
            width: "100%", //设置下拉框的宽度
            theme: "classic"
        });
        {notempty name = "vo['car_type_id']"}
        car_type_id.val("{$vo['car_type_id']}").trigger("change");
        {/notempty}
            //用户select2 js部分 end
            //用户select2 js部分 start seats
            var seats = $("#seats").select2({
                language: "zh-CN", //设置 提示语言
                width: "40%", //设置下拉框的宽度
                theme: "classic"
            });
            {notempty name = "vo['seats']"}
            seats.val("{$vo['seats']}").trigger("change");
            {/notempty}
                //用户select2 js部分 end
            //用户select2 js部分 car_type_id
            var user_id = $("#user_id").select2({
                language: "zh-CN", //设置 提示语言
                width: "100%", //设置下拉框的宽度
                theme: "classic"
            });
            {notempty name = "vo['user_id']"}
            user_id.val("{$vo['user_id']}").trigger("change");
            {/notempty}
                //用户select2 js部分 end

                //用户select2 js部分 car_type_id
                    var car_brand_id = $("#car_brand_id").select2({
                        language: "zh-CN", //设置 提示语言
                        width: "100%", //设置下拉框的宽度
                        theme: "classic"
                    });
                    {notempty name = "vo['car_brand_id']"}
                    car_brand_id.val("{$vo['car_brand_id']}").trigger("change");
                    {/notempty}
                        //用户select2 js部分 end

                        //用户select2 js部分 car_type_id
                        var car_model_id = $("#car_model_id").select2({
                            language: "zh-CN", //设置 提示语言
                            width: "100%", //设置下拉框的宽度
                            theme: "classic"
                        });
                        {notempty name = "vo['car_model_id']"}
                        car_model_id.val("{$vo['car_model_id']}").trigger("change");
                        {/notempty}
                            //用户select2 js部分 end

            $("[name='leave_status'][value='{$vo.leave_status ?? '1'}']").attr("checked", true);
            $("[name='isagreee'][value='{$vo.isagreee ?? '1'}']").attr("checked", true);


    })
</script>
<script>
    function getCarBrand(val) {
        // 获取选中的值 car_type_id
        var car_type_id = $('#car_type_id  option:selected').val();
        if (!car_type_id) {
            return false;
        } else {
            // 清空车辆品牌和汽车类型
            $('#car_brand_id').empty()
            $('#car_model_id').empty()
        }
        // 根据车型id查找车辆品牌
        $.ajax({
            type: 'post',
            url: '/admin/driver/get_car_brand',
            data: {id: car_type_id},
            success: function (data) {
                console.log('接收数据', data);
                var car_brand_list = data.data.car_brand_list;
                var car_model_list = data.data.car_model_list;
                if (!data.code && car_brand_list != null) { // 有数据传输过来
                    // 获取长度
                    var len = car_brand_list.length;
                    for (var i = 0; i < len; i++) {
                        $('#car_brand_id').append("<option value='" + car_brand_list[i].id + "'>" + car_brand_list[i].brand_name + "</option>")
                        $('#car_brand_id option:eq(0)').attr('selected', 'selected');//选中第一个
                    }
                    // 获取汽车型号的长度
                    var modelLen = car_model_list.length
                    if (modelLen > 0) {
                        for (var j = 0; j < modelLen; j++) {
                            $('#car_model_id').append("<option value='" + car_model_list[j].id + "'>" + car_model_list[j].car_model + "</option>")
                            $('#car_model_id option:eq(0)').attr('selected', 'selected');//选中第一个
                        }
                    }else{
                    layer.msg('默认选择的车辆品牌没有汽车型号数据');
                }
                } else {
                    layer.msg('该车类型没有车辆品牌数据')
                }
            }
        })
    }
    function getCarModel() {
        // 获取选中的值 car_type_id
        var car_brand_id = $('#car_brand_id  option:selected').val();
        if (!car_brand_id) {
            return false;
        } else {
            // 清空汽车类型
            $('#car_model_id').empty()
        }
        // 根据车型id查找车辆品牌
        $.ajax({
            type: 'post',
            url: '/admin/driver/get_car_model',
            data: {id: car_brand_id},
            success: function (data) {
                console.log('接收数据', data);
                if (!data.code && data.data != null) { // 有数据传输过来
                    // 获取长度
                    var len = data.data.length;
                    for (var i = 0; i < len; i++) {
                        $('#car_model_id').append("<option value='" + data.data[i].id + "'>" + data.data[i].car_model + "</option>")
                        $('#car_model_id option:eq(0)').attr('selected', 'selected');//选中第一个
                    }
                } else {
                    layer.msg('该车类型没有车辆品牌数据')
                }
            }
        })
    }
</script>
<script>
    var fromSelects = layui.formSelects;
</script>
{/block}
